<?php
/* --------------------------------------------------------------
   to_delete.php 2022-10-24
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2022 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------
*/

clearstatcache(true);

$toDelete = [
    'GXMainComponents/Controllers/HttpView/Admin/NewAttributesController.inc.php',
    'GXModules/Gambio/KlarnaOnSiteMessaging/*',
    'GambioAdmin/Modules/Deprecated/*',
    'GambioAdmin/Modules/ProductOption/ui/assets/Components/Shared/OptionValueModal/Vpe.vue',
    'GambioAdmin/Modules/Statistics/*',
    'GambioAdmin/build/js/dhlreturns.js',
    'GambioAdmin/build/js/dhlreturns.js.map',
    'GambioAdmin/build/js/productdownload.js',
    'GambioAdmin/build/js/productdownload.js.map',
    'GambioAdmin/build/js/productoption.js',
    'GambioAdmin/build/js/productoption.js.map',
    'GambioAdmin/build/js/statistics.js',
    'GambioAdmin/build/js/statistics.js.map',
    'GambioAdmin/build/styles/dhlreturns.css',
    'GambioAdmin/build/styles/dhlreturns.css.map',
    'GambioAdmin/build/styles/productdownload.css',
    'GambioAdmin/build/styles/productdownload.css.map',
    'GambioAdmin/build/styles/productoption.css',
    'GambioAdmin/build/styles/productoption.css.map',
    'GambioAdmin/build/styles/statistics.css',
    'GambioAdmin/build/styles/statistics.css.map',
    'GambioShop/Components/Attributes/SellingUnit/Database/Listener/OnGetSellingUnitVpeEventListener.php',
    'GambioShop/Components/Attributes/SellingUnitEan/*',
    'admin/create_account.php',
    'admin/customers.php',
    'admin/includes/ckeditor/plugins/backgrounds/*',
    'admin/includes/ckeditor/plugins/confighelper/*',
    'admin/includes/ckeditor/plugins/fakeobjects/*',
    'admin/includes/ckeditor/plugins/flash/*',
    'admin/includes/ckeditor/plugins/qrc/images/qrc.png',
    'admin/includes/ckeditor/plugins/qrc/images/qrc400.png',
    'admin/includes/ckeditor/plugins/wsc/*',
    'admin/includes/ckeditor/skins/moono/dialog_opera.css',
    'admin/includes/modules/new_attributes_change.php',
    'admin/includes/modules/new_attributes_config.php',
    'admin/includes/modules/new_attributes_functions.php',
    'admin/includes/modules/new_attributes_include.php',
    'admin/includes/modules/new_attributes_select.php',
    'includes/classes/scssphp-0.5.1/*',
    'includes/classes/scssphp/*',
    'lang/english/original_sections/admin/statistics.lang.inc.php',
    'lang/english/original_sections/admin/statistics_service.lang.inc.php',
    'lang/german/original_sections/admin/statistics.lang.inc.php',
    'lang/german/original_sections/admin/statistics_service.lang.inc.php',
    'system/classes/languages/LocalizedDate.php',
    'system/overloads/AdminApplicationTopExtenderComponent/MailBeezAdminApplicationTopExtender.inc.php',
    'vendor/cache/*',
    'vendor/composer/package-versions-deprecated*',
    'vendor/doctrine/dbal/.doctrine-project.json',
    'vendor/doctrine/dbal/SECURITY.md',
    'vendor/doctrine/dbal/UPGRADE.md',
    'vendor/doctrine/dbal/ci/*',
    'vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLServerDriver/PortWithoutHost.php',
    'vendor/gambio-hub/klarna-on-site-messaging/*',
    'vendor/league/flysystem-sftp/LICENSE',
    'vendor/league/flysystem-sftp/readme.md',
    'vendor/league/flysystem-sftp/src/*',
    'vendor/league/flysystem/CODE_OF_CONDUCT.md',
    'vendor/league/flysystem/SECURITY.md',
    'vendor/league/flysystem/deprecations.md',
    'vendor/league/flysystem/src/Adapter/*',
    'vendor/league/flysystem/src/ConfigAwareTrait.php',
    'vendor/league/flysystem/src/ConnectionErrorException.php',
    'vendor/league/flysystem/src/ConnectionRuntimeException.php',
    'vendor/league/flysystem/src/Directory.php',
    'vendor/league/flysystem/src/Exception.php',
    'vendor/league/flysystem/src/File.php',
    'vendor/league/flysystem/src/FileExistsException.php',
    'vendor/league/flysystem/src/FileNotFoundException.php',
    'vendor/league/flysystem/src/FilesystemInterface.php',
    'vendor/league/flysystem/src/FilesystemNotFoundException.php',
    'vendor/league/flysystem/src/Handler.php',
    'vendor/league/flysystem/src/InvalidRootException.php',
    'vendor/league/flysystem/src/NotSupportedException.php',
    'vendor/league/flysystem/src/Plugin/*',
    'vendor/league/flysystem/src/ReadInterface.php',
    'vendor/league/flysystem/src/RootViolationException.php',
    'vendor/league/flysystem/src/SafeStorage.php',
    'vendor/league/flysystem/src/UnreadableFileException.php',
    'vendor/league/flysystem/src/Util/*',
    'vendor/mpdf/mpdf/src/RemoteContentFetcher.php',
    'vendor/nikic/php-parser/.editorconfig',
    'vendor/php-http/guzzle6-adapter/*',
    'vendor/phpmailer/phpmailer/phpunit.xml.dist',
    'vendor/sentry/sentry/codecov.yml',
    'vendor/sentry/sentry/src/Context/Context.php',
    'vendor/sentry/sentry/src/Context/ServerOsContext.php',
    'vendor/sentry/sentry/src/Context/TagsContext.php',
    'vendor/sentry/sentry/src/Context/UserContext.php',
    'vendor/sentry/sentry/src/EventFactory.php',
    'vendor/sentry/sentry/src/EventFactoryInterface.php',
    'vendor/sentry/sentry/src/Exception/MissingProjectIdCredentialException.php',
    'vendor/sentry/sentry/src/Exception/MissingPublicKeyCredentialException.php',
    'vendor/sentry/sentry/src/FlushableClientInterface.php',
    'vendor/sentry/sentry/src/HttpClient/PluggableHttpClientFactory.php',
    'vendor/sentry/sentry/src/Integration/Handler.php',
    'vendor/sentry/sentry/src/Spool/*',
    'vendor/sentry/sentry/src/Transport/ClosableTransportInterface.php',
    'vendor/sentry/sentry/src/Transport/SpoolTransport.php',
    'vendor/slim/slim/Slim/Factory/Psr17/ZendDiactorosPsr17Factory.php',
    'vendor/smarty/smarty/COMPOSER_RELEASE_NOTES.txt',
    'vendor/smarty/smarty/INHERITANCE_RELEASE_NOTES.txt',
    'vendor/smarty/smarty/NEW_FEATURES.txt',
    'vendor/smarty/smarty/README',
    'vendor/smarty/smarty/SMARTY_2_BC_NOTES.txt',
    'vendor/smarty/smarty/SMARTY_3.0_BC_NOTES.txt',
    'vendor/smarty/smarty/SMARTY_3.1_NOTES.txt',
    'vendor/smarty/smarty/expectException',
    'vendor/smarty/smarty/libs/SmartyBC.class.php',
    'vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include_php.php',
    'vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_php.php',
    'vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_registered.php',
    'vendor/symfony/var-dumper/Caster/MongoCaster.php',
    'vendor/symfony/var-dumper/Tests/*',
    'vendor/symfony/var-dumper/phpunit.xml.dist',
];

// checks if the paypal3 module is being used by the shop, if not we delete the module
$result = $this->query("SELECT `key` FROM `gx_configurations` WHERE `key` = 'configuration/MODULE_PAYMENT_INSTALLED' AND `value` LIKE '%paypal3.php%';", true);
if ($result->num_rows < 1) {
    $toDelete = array_merge($toDelete, ['includes/modules/payment/paypal3.php']);
}

return $toDelete;
